Skip to main content

saveStackRequest

Type

message

Summary

Sent to the current card when the stack is about to be saved.

Syntax

saveStackRequest

Description

Handle the saveStackRequest message if you need to do cleanup or other actions before a stack is saved. For example, if the stack creates temporary objects that should not be saved with the stack, you can write a saveStackRequest handler to delete those objects before the stack is saved.

The save action is triggered by the saveStackRequest message. This means that trapping the saveStackRequest message and not passing it prevents the stack from being saved. The LiveCode IDE locks messages when Save or Save As... are chosen from the File menu to ensure that the save occurs.

Examples

on saveStackRequest -- delete all cards but the first
repeat with x = the number of cards down to 2
delete card x
end repeat
pass saveStackRequest -- or the stack won't be saved
end saveStackRequest

property: filename, filename of stack

glossary: object, handler, current card, pass, message, trap

message: closeStack

object: stack

Compatibility and Support

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?